﻿@model yq.Model.Logic.SysTask
@using (Ajax.BeginForm("DoAddTask", new { }, new AjaxOptions { HttpMethod = "post", OnSuccess = "InitializeTips" }))
{
    <div class="alert alert-success" style="margin-bottom: 0px; margin-top: 0px">
        添加任务 (循环任务间隔时间必须大于3秒)
    </div>
    <table class="table table-bordered table-striped">
        <tbody>
            <tr>
                <td>
                    @(Html.RawFor(obj => obj.Title)):
                </td>
                <td >
                    @Html.TextBoxFor(obj => obj.Title)
                </td>
                <td>
                    @(Html.RawFor(obj => obj.Types)):
                </td>
                <td >
                    @Html.SelectEnumFor(obj => obj.Types, yq.Enums.SysTask.Types.Default)
                </td>
            </tr>
            <tr>
                <td>
                    @(Html.RawFor(obj => obj.StartTime)):
                </td>
                <td >
                    @Html.TimeFor(obj => obj.StartTime, HtmlExtensions.DatePickerFmt.yyyyMMddHHmm)
                </td>
                <td>
                    @(Html.RawFor(obj => obj.State)):
                </td>
                <td >
                    @Html.SelectEnumFor(obj => obj.State, yq.Enums.SysTask.State.Default)
                </td>
            </tr>
            <tr>
                <td>
                    @(Html.RawFor(obj => obj.Interval)):
                </td>
                <td >
                    @Html.TextBoxFor(obj => obj.Interval)
                    
                </td>
                <td>
                    @(Html.RawFor(obj => obj.OutInterval)):
                </td>
                <td >
                    @Html.TextBoxFor(obj => obj.OutInterval, new { style = " width:80px" })<span class="add-on" >秒</span>
                </td>
            </tr>
            <tr>
                <td>
                    @(Html.RawFor(obj => obj.RunPath)):
                </td>
                <td >
                    @Html.TextBoxFor(obj => obj.RunPath)
                </td>
                <td>
                    @(Html.RawFor(obj => obj.Json)):
                </td>
                <td >
                    @Html.TextBoxFor(obj => obj.Json)
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td >
                    @Html.Submit()
                </td>
                <td>
                </td>
                <td>
                
                </td>
            </tr>
        </tbody>
    </table>
}
<script>

    function InitializeTips(obj)
    {
        if (obj.Status == 1)
        {
               $.tips("添加成功");
               setTimeout("window.location = window.location;",2000);
        } else
        {
            $.tips(obj.ErrorText);
        }

    }
</script>